package com.java3_3;

//饿汉单例模式
public class Demo1 {
    private String name;
    private int age;

    private Demo1(String name, int age) {
        this.name = name;
        this.age = age;
    }

    private static final Demo1 demo1 = new Demo1("zhangsan",20);

    public static Demo1 getDemo1() {
        return demo1;
    }
}
